import 'dart:async';

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:leader_help/page/home/key_point/key_point_microcosmic/key_point_small_view.dart';
import 'package:leader_help/utils/ifly/xf_api_utils.dart';

import 'key_task_state.dart';

class KeyTaskLogic extends GetxController
    with GetSingleTickerProviderStateMixin {
  final KeyTaskState state = KeyTaskState();

  // 如果需要和 TabBarView 联动， TabBar 和 TabBarView 使用同一个 TabController 即可
  late TabController controller;

  /// 折叠面板 是否展开
  late bool isExpanded = true;

  @override
  void onInit() {
    super.onInit();
    controller = TabController(vsync: this, length: state.tabs.length);
  }

  @override
  void onReady() {
    super.onReady();
  }

  /// 修改设为重点
  void setSelect() {
    if (state.select.value) {
      state.select.value = false;
    } else {
      state.select.value = true;
    }
  }

  void actionToPointSmall(int index) {
    Get.to(() => const KeyPointSmallPage());
  }

  @override
  void onClose() {
    super.onClose();
    controller.dispose();
  }
}
